package com.weiqiao.api.repository.impl;

import com.weiqiao.api.repository.ICommodityApiRepository;
import com.weiqiao.base.dao.impl.BaseMongoDaoImpl;
import org.bson.conversions.Bson;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("CommodityApiRepositoryImpl")
public class CommodityApiRepositoryImpl extends BaseMongoDaoImpl implements ICommodityApiRepository {

    private final static String collectionName = "commodity";


    @Override
    public List<String> getPageList(int companyId, Bson filter, Pageable pageable) {
        return super.getListAndPage(collectionName, filter, pageable);
    }

    @Override
    public List<String> getPageList(int companyId, Bson filter, Bson sort, int skip, int limit) {
        return super.findFilterSortSkipLimit(collectionName, filter, sort, skip, limit);
    }

    @Override
    public String findCommodityDetail(Bson filter) {
        return this.findOne(collectionName, filter);
    }
}
